<?php

class IndexController extends Mac_Controller {

	protected $db;
	
    public function init() {
        //$this->layout->addScript('jquery.js');
        $this->layout->addStylesheet('styles.css');
        $this->layout->setHeadTitle('Crosser Page Test');
    }

    public function indexAction() {
        
        /*$result = Db_Query_Select::fields('b')
                ->from(Db_Clause_From::tables('table1'))
                ->where(Db_Clause_Where::clauses('b', Db_Type_Op::LIKE, 't%'))
                ->execute();
        
        echo 'start';
        while ($row = mysql_fetch_array($result)) {
            print_r($row);
        }
        echo 'end';*/
        
        /*$req = Db_Query_Insert::into('table1')
            ->value('b', 'kiki')
            ->execute();
        echo $req;*/
        
        /*$req = Db_Query_Update::table('table1')
            ->value('b', 'toto')
            ->where(Db_Clause_Where::clauses('b', Db_Type_Op::LIKE, 't%'))
            ->limit(1)
            ->orderBy('a')
            ->execute();
        echo $req;*/
        
        /*$req = Db_Query_Delete::from('table1')
            ->where(Db_Clause_Where::clauses('b', Db_Type_Op::EQUALS, 'kiki'))
            ->limit(1)
            ->orderBy('a')
            ->execute();
        echo $req;*/
        
        $ns = Mac_Session::getNamespace(Mac_User::SESSION_NAMESPACE);
        
        /*echo '<pre>';
        print_r($ns);
        //User::login('Sokaru', 'toto');
        
        //$this->restrictAccess('admin');
        
        echo '</pre>';*/
        $this->view->result = 'ok';
    }
    
    public function testAction() {
        $this->useView('index');
    }
}